package leetcode.code070;

/**
 * Dp 100%
 * @author Max
 * @date 2021年8月23日
 * @description
 */
public class Solution07001 extends ClimbingStairs {

	@Override
	public int climbStairs(int n) {
		if (n == 1)
			return 1;
		if (n == 2)
			return 2;
		int[] climb = new int[n + 1];
		climb[1] = 1;
		climb[2] = 2;
		for (int i = 3; i <= n; i++) {
			climb[i] = climb[i - 1] + climb[i - 2];
		}
		return climb[n];
	}

	public static void main(String[] args) {
		Solution07001 so = new Solution07001();
		so.debug1();
		so.debug2();
	}

}
